<template>
  <div class="aside-container">
    <el-aside width="200px" style="background-color: rgb(238, 241, 246)">
      <el-image :src="require('@/assets/logo.png')"></el-image>
      <el-menu
        unique-opened
        router
        default-active="/user/commonUser"
        :default-openeds="['1']"
      >
        <el-submenu index="1">
          <template slot="title">
            <i class="iconfont icon-yonghu"></i>
            用户
          </template>
          <el-menu-item index="/user/commonUser">会员管理</el-menu-item>
          <el-menu-item index="/user/adminUser">管理员管理</el-menu-item>
        </el-submenu>

        <el-submenu index="2">
          <template slot="title">
            <i class="iconfont icon-fenlei"></i>
            分类
          </template>
          <el-menu-item index="/category/firstCategory"
            >一级分类</el-menu-item
          >
          <el-menu-item index="/category/secondCategory"
            >二级分类</el-menu-item
          >
          <el-menu-item index="/category/thirdCategory"
            >三级分类</el-menu-item
          >
        </el-submenu>

        <el-submenu index="3">
          <template slot="title">
            <i class="iconfont icon-shangpin"></i>
            商品
          </template>
          <el-menu-item index="/commodity/goods">商品管理</el-menu-item>
          <el-menu-item index="/commodity/goods-type">型号管理</el-menu-item>
        </el-submenu>

        <el-submenu index="5">
          <template slot="title">
            <i class="iconfont icon-shuju"></i>
            数据分析
          </template>
          <el-menu-item index="/analysis/userAnalysis">用户分析</el-menu-item>
          <el-menu-item index="/analysis/commodityAnalysis"
            >商品分析</el-menu-item
          >
          <el-menu-item index="/analysis/commentAnalysis"
            >评论统计</el-menu-item
          >
        </el-submenu>

        <el-submenu index="6">
          <template slot="title">
            <i class="iconfont icon-xitong"></i>
            系统管理
          </template>
          <el-menu-item index="/system/authority">权限管理</el-menu-item>
        </el-submenu>
      </el-menu>
    </el-aside>
  </div>
</template>

<script>
export default {
  name: "AsideIndex",
  components: {},
  props: {},
  data() {
    return {};
  },
  created() {},
  mounted() {},
  methods: {},
  computed: {},
  watch: {},
};
</script>

<style scoped lang="less">
.aside-container {
  .el-aside {
    height: 100%;
    background: #343938 !important;
    font: 14px/1.5 "华文楷体", tahoma, arial, "Hiragino Sans GB", "\5b8b\4f53",
      sans-serif;
    overflow-x: hidden;

    .el-image {
      padding: 10px;
    }
  }

  /* 让标题与图标对齐 */
  :deep(.el-menu) {
    background-color: unset;
    .el-submenu {
      .el-submenu__title {
        font-size: 18px;
        font-weight: 500;
        display: flex;
        align-items: center;
        transition: all 0.2s;
        color: #becbd9;
        .iconfont {
          font-size: 18px;
          margin-right: 8px;
          color: inherit;
        }
      }

      .el-submenu__title:hover {
        background: unset;
        color: #fff;
      }

      .el-menu-item {
        font-size: 16px;
        transition: all 0.3s;
        font-weight: 600;
        color: #becbd9;
        padding-left: 60px !important;
        border-radius: 0 50px 50px 0;
      }
      .el-menu-item:hover {
        background: unset;
        color: #fff;
      }
    }
  }
}
.el-menu-item.is-active {
  color: #000 !important;
  background-color: #ffc11e !important;
  font-weight: 700;
}

/* 设置展开分类的颜色 */
:deep(li.is-opened) {
  .el-submenu__title {
    font-weight: 700 !important;
  }
}
</style>
